/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Controller;

import UserInterface.SRCMain;
import java.util.LinkedList;

/**
 *
 * @author subx, asouza
 */
public class Main {

    public static void main(String[] args) {
        SRCMain.main(args);
        Graph graph = new Graph();
        if (graph.isEmpty()) {
            System.out.println("Empty");
        }
        
        graph.setNode(0, 0, 0, 10);
        graph.setNode(1, 0, 0, 10);
        graph.setNode(2, 0, 0, 10);
        graph.setNode(3, 0, 0, 10);
        graph.setNode(4, 0, 0, 10);
        graph.setEdge(0, 1, 1);
        graph.setEdge(0, 2, 2);
        graph.setEdge(0, 3, 3);
        graph.setEdge(0, 4, 4);
        graph.setEdge(1, 2, 5);
        graph.setEdge(1, 3, 6);
        graph.setEdge(1, 4, 7);
        graph.setEdge(2, 3, 8);
        graph.setEdge(2, 4, 9);
        graph.setEdge(3, 4, 12);
        graph.printNodes(graph.getNodes());
        graph.printEdges(graph.getMatrix());
        if (graph.isConnected())
            System.out.println("É conexo!");
        if (graph.isEulerian())
            System.out.println("Euleriano1!");
        graph.removeEdge(0, 1);
        graph.removeEdge(1, 0);
        graph.printNodes(graph.getOddDegreeNodes());
        if (graph.isEulerian())
            System.out.println("Euleriano!");
        if (graph.checkMax(10)) {
            System.out.println("Rolou!");
        }
        graph.setEdge(0, 1, 1);
        if (graph.checkMax(9)) {
            System.out.println("Rolou!1");
        }
        if (graph.isEulerian())
            System.out.println("Euleriano2!");
        graph.printNodes(graph.getSucessors(0));
        System.out.println("");
        System.out.println("");
        System.out.println("");
        graph.printEdgesList(graph.eulerianPath());
        System.out.println("");
        System.out.println(graph.getTotalCost());
        System.out.println("");
        System.out.println("");
        AVLTree<Integer, Carteiro> tree = new AVLTree<Integer, Carteiro>();
        if (graph.checkMax(13))
        tree = graph.divideCarteiros(13);
        System.out.println("");
        tree.printAVL(tree.getRoot());
        LinkedList<Carteiro> cart = new LinkedList<Carteiro>();
        cart = tree.toList(tree.getRoot());
        for (int i = 0; i < cart.size(); i++) {
            graph.printEdgesList(cart.get(i).getEdges());
            System.out.println("");
        }
    }
}
